package com.moneywelcome.orderfacade;

import com.moneywelcome.orderfacade.dto.DividendOrderDto;
import com.moneywelcome.orderfacade.dto.RedeemOrderDto;
import com.moneywelcome.orderfacade.dto.SubscribeOrderDto;
import com.moneywelcome.orderfacade.vo.DividendRecordVo;
import com.moneywelcome.orderfacade.vo.InvestRecordVo;
import com.moneywelcome.orderfacade.vo.RedeemRecordVo;
import com.moneywelcome.results.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;

@FeignClient(
        contextId="orderCreatApi",//服务名字
        value = "invest-order" // 区分不同client
)
public interface OrderCreatApi {
    @PostMapping("/subscribe")
    Result<SubscribeOrderDto> subscribeOrder(@RequestBody InvestRecordVo investRecordVo);
    @PostMapping("/redeem")
    Result<RedeemOrderDto> redeemOrder(@RequestBody RedeemRecordVo redeemRecordVo);
    @PostMapping("/subscribeComplete")
    Result<SubscribeOrderDto> subscribeComplete() throws IOException;
    @PostMapping("/redeemComplete")
    Result<RedeemOrderDto> redeemComplete() throws IOException;
    @PostMapping("/dividend")
    Result<DividendOrderDto> dividendOrder(@RequestBody DividendRecordVo dividendRecordVo);
}
